import { createWebHistory, createRouter } from 'vue-router'
import Index from '../views/Index.vue'
import _404 from '../views/404.vue'
import Classify from '../components/Classify.vue'
import First from '../components/First.vue'
import Goods from '../components/Goods.vue'
import User from '../components/user.vue'
import Login from '../views/Login.vue'


const Router = createRouter({
    history: createWebHistory(),
    routes: [{
        path: '/',
        redirect: '/login'
    }, {
        path: '/login',
        component: Login
    }, {
        path: '/index',
        component: Index,
        redirect: '/index/first',

        children: [{
            path: 'first',
            component: First
        }, {
            path: 'classify',
            component: Classify
        }, {
            path: 'goods',
            component: Goods
        }, {
            path: 'user',
            component: User
        }]
    }, {
        path: '/:pathMatch(.*)*',
        component: _404
    }, ]
})

export default Router